<?php
    // +----------------------------------------------------------------------
    // | Created by PHPstorm: JRKAdmin框架 [ JRKAdmin ]
    // +----------------------------------------------------------------------
    // | Copyright (c) 2019~2022 [LuckyHHY] All rights reserved.
    // +----------------------------------------------------------------------
    // | SiteUrl: http://www.luckyhhy.cn
    // +----------------------------------------------------------------------
    // | Author: LuckyHhy <jackhhy520@qq.com>
    // +----------------------------------------------------------------------
    // | Date: 2019/12/13-16:35
    // +----------------------------------------------------------------------
    // | Description:  
    // +----------------------------------------------------------------------


    namespace app\admin\service;


    use app\admin\model\AdminUser;

    class AdminUserService extends BaseService
    {


        protected function initialize()
        {
            parent::initialize(); // TODO: Change the autogenerated stub
            $this->table=DB_PREFIX.'admin_user';
            $this->model=new AdminUser();
        }


        /**
         * @param $id
         * @return array|\PDOStatement|string|\think\Model|null
         * @throws \think\db\exception\DataNotFoundException
         * @throws \think\db\exception\ModelNotFoundException
         * @throws \think\exception\DbException
         * @author: LuckyHhy <jackhhy520@qq.com>
         * @date: 2020/1/3
         * @name: getOne
         * @describe:获取单个信息
         */
        public static function getOne($id){
            $info=self::where("id",$id)->find();
            return $info;
        }



        /**
         * @param array $where
         * @return array
         * @throws \think\db\exception\DataNotFoundException
         * @throws \think\db\exception\ModelNotFoundException
         * @throws \think\exception\DbException
         * @author: LuckyHhy <jackhhy520@qq.com>
         * @date: 2020/1/14
         * @name: userList
         * @describe:管理员列表
         */
        public static function userList($where=[]){
                //排序数字越大越靠前
                $where['status']=1;
                $result=self::where($where)->order("id")->select()->toArray();
                return $result;
        }






    }